package com.woniu.order.client;

import com.woniu.order.client.result.CommentQueryResultInfo;
import com.woniu.order.client.result.OrderQueryResultInfo;
import com.woniu.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
* name是项目名，contextId是client的名字
*/
@FeignClient(contextId = "commentQueryClient",name="order")
public interface CommentQueryClient {

    /**
     * 根据商品ID查询关于此商品的评论
     * @param productId
     * @return
     */
    @GetMapping("searchCommentsByProductId")
    public Result<List<CommentQueryResultInfo>> searchCommentsByProductId(@RequestParam("productId") Integer productId);


    /**
     * 根据用户ID查询此用户的所有评论
     * @param userId
     * @return
     */
    @GetMapping("searchCommentsByUserId")
    public Result<List<CommentQueryResultInfo>> searchCommentsByUserId(@RequestParam("userId") Integer userId);


}
